< previous page page_295 next page >

Page 295
SELECT Publishers.Name,PublisherComments.Comments
   FROM Publishers LEFT JOIN PublisherComments
   ON Publishers.PubID = PublisherComments.PubID
0295-01.jpg
Figure 8.29.
Using an 
INNER JOIN on a nonunique column.
0295-02.jpg
Figure 8.30.
Using the 
LEFT JOIN clause.
Notice that the result set has blank comments in several places. The LEFT JOIN is handy when you want a list of all the records in the master table and any records in the dependent table that are on file.
The RIGHT JOIN
The RIGHT JOIN works the same as the LEFT JOIN except that the result set is based on the second (right-hand) table in the JOIN statement. You can use the RIGHT JOIN in the same manner you would use the LEFT JOIN.

 
< previous page page_295 next page >

If you like this book, buy it!